package cn.yzc.mapper;

import cn.yzc.pojo.Leave;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.sql.Timestamp;
import java.util.List;

/**
 * <p>Project: SpringPro - LeaveMapper</p>
 * <p>Powered by yzc On 2023-10-24 16:36:19</p>
 * <p>描述：<p>
 *
 * @author yzc [yzc0415@126.com]
 * @version 1.0
 * @since 17
 */
@Mapper
public interface LeaveMapper {

    /**
     * 保存请假人
     *
     * @param leave
     * @return
     */
    int save(Leave leave);

    /**
     * 查看个人请假历史记录
     *
     * @param user
     * @return
     */
    List<Leave> queryUser(String user);

    /**
     * 修改请假
     *
     * @param leave
     * @return
     */
    int updateLeave(Leave leave);

    /**
     * 销假
     *
     * @param user
     * @return
     */
    int updateStatus(String user);

    /**
     * 待审批的请假列表
     *
     * @return
     */
    List<Leave> queryStatus();

    /**
     * 批准
     *
     * @param user
     * @return
     */
    int approve(@Param("user") String user, @Param("auditdate") Timestamp auditdate);

    /**
     * 拒绝
     *
     * @param user
     * @param auditdate
     * @param reject
     * @return
     */
    int rejected(@Param("user") String user, @Param("auditdate") Timestamp auditdate, @Param("reject") String reject);


    Leave queryParticulars(int id);
}
